/******************************************************************
 * Created by: DO HOANG HAI                                       
 * Date of Creation:                                               
 * Date of last modification: 1st/Sep/2007
 *                                                                
 * Description:                                 
 * ...
 ******************************************************************/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Pbdms.Common.GUI
{
    public partial class MsgBoxTwoButtons : Form
    {
        public const int YES_NO = 0;
        public const int OK_CANCEL = 1;
        public const int DIALOG_RESULT_YES = 1;
        public const int DIALOG_RESULT_NO = -1;
        public const int DIALOG_RESULT_OK = 1;
        public const int DIALOG_RESULT_CANCEL = -1;

        private int style = 1;
        public int returnValue = 0;
        public MsgBoxTwoButtons(String msg, int style, char c)
        {
            InitializeComponent();
            this.lblMessage.Text = msg;
            this.style = style;
            if (style != 1)
            {
                btnOK.Text = "Yes";
                btnCancel.Text = "No";
            }
            if (c == 'W')
            {
                picImageC.Image = global::Pbdms.Common.Properties.Resources.warning;
                this.Text = "Pbdms - Warning";
            }
            else
            {
                picImageC.Image = global::Pbdms.Common.Properties.Resources.inform;
                this.Text = "Pbdms - Inform";
            }
           
            Pbdms.Common.Global.paintBackGround(this);
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            returnValue = 1;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {            
            returnValue = -1;
            this.Close();
        }

    }
}